<template>
  <div class="sample-container">
    <div class="content_r">
      <el-form
        :model="queryParams"
        ref="queryForm"
        :inline="true"
        v-show="showSearch"
        label-width="68px"
      >
        <el-form-item label="应用范围" prop="company">
          <el-select
            v-model="queryParams.appliedRange"
            placeholder="请选择应用范围"
            clearable
            size="small"
          >
            <el-option
              v-for="item in shiyongfanweiOptions"
              :key="item.value"
              :label="item.dictLabel"
              :value="item.dictValue"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="示例类型" prop="type">
          <el-select
            v-model="queryParams.type"
            placeholder="请选择示例类型"
            clearable
            size="small"
          >
            <el-option
              v-for="item in typeList"
              :key="item.value"
              :label="item.dictLabel"
              :value="item.dictValue"
            />
          </el-select>
        </el-form-item>

        <el-form-item label="标识分类" prop="identifyClassify">
          <el-select
            v-model="queryParams.classifyId"
            placeholder="请选择标识分类"
            clearable
            size="small"
            @change="classifyChange"
          >
            <el-option
              v-for="item in indetifyClassifyOptions"
              :key="item.id"
              :label="item.label"
              :value="item.id"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="标识名称" prop="identifyName">
          <el-select
            v-model="queryParams.nameId"
            placeholder="请选择标识名称"
            clearable
            size="small"
            @change="$forceUpdate()"
          >
            <el-option
              v-for="item in identifyNameOptions"
              :key="item.id"
              :label="item.label"
              :value="item.id"
              :disabled="item.disabled"
            />
          </el-select>
        </el-form-item>

        <el-form-item>
          <el-button
            type="cyan"
            icon="el-icon-search"
            size="mini"
            @click="handleQuery"
            >搜索</el-button
          >
          <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
            >重置</el-button
          >
        </el-form-item>
      </el-form>

      <el-row :gutter="10" class="mb8">
        <el-col :span="1.5">
          <el-button
            type="primary"
            icon="el-icon-plus"
            size="mini"
            @click="handleAdd"
            v-hasPermi="['system:sample:add']"
            >新增</el-button
          >
        </el-col>
        <!-- <el-col :span="1.5">
          <el-button type="success" icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" v-hasPermi="['system:sample:edit']">修改</el-button>
        </el-col> -->
        <el-col :span="1.5">
          <el-button
            type="danger"
            icon="el-icon-delete"
            size="mini"
            :disabled="multiple"
            @click="handleDelete"
            v-hasPermi="['system:sample:remove']"
            >删除</el-button
          >
        </el-col>
        <el-col :span="1.5">
          <el-button
            type="warning"
            icon="el-icon-download"
            size="mini"
            @click="handleExport"
            v-hasPermi="['system:sample:export']"
            >导出</el-button
          >
        </el-col>
        <right-toolbar
          :showSearch.sync="showSearch"
          @queryTable="getList"
        ></right-toolbar>
      </el-row>

      <el-table :data="imgList" @selection-change="handleSelectionChange">
        <el-table-column type="selection" width="50" align="center" />
        <el-table-column type="index" width="50" align="center" />
        <el-table-column
          label="缩略图"
          align="center"
          prop="thumbnailImg"
          width="130"
        >
          <template slot-scope="scope">
            <el-image
              class="thumbnailImg"
              style="width: 100%; height: 50px"
              :src="`${scope.row.thumbnailImg[0]}`"
              :preview-src-list="scope.row.thumbnailImg"
            >
            </el-image>
          </template>
        </el-table-column>
        <el-table-column
          label="应用范围"
          align="center"
          prop="appliedRange"
          width="120"
          :formatter="appliedRangeFormat"
        />

        <el-table-column
          label="标识类别"
          align="center"
          prop="classifyName"
          width="90"
        />
        <el-table-column
          label="标识名称"
          align="center"
          prop="name"
          show-overflow-tooltip
        />
        <!-- <el-table-column
          label="标识位置"
          align="center"
          prop="location"
          show-overflow-tooltip
        /> -->
        <!-- <el-table-column
          label="标识数量"
          align="center"
          prop="num"
        /> -->
        <!-- <el-table-column label="制作时间" align="center" prop="createTime" show-overflow-tooltip width="160" /> -->
        <!-- <el-table-column
          label="设计制作供应商"
          align="center"
          prop="company"
          show-overflow-tooltip
        /> -->
        <!-- <el-table-column
          label="制作日期"
          align="center"
          prop="productTime"
          show-overflow-tooltip
        />
        <el-table-column
          label="管理人员"
          align="center"
          prop="manager"
        /> -->
        <el-table-column
          label="创建时间"
          align="center"
          prop="createTime"
          width="160"
        />
        <!--
        <el-table-column
          label="录入人员"
          align="center"
          prop="createBy"
          show-overflow-tooltip
        /> -->

        <el-table-column
          label="示例类型"
          align="center"
          prop="type"
          show-overflow-tooltip
        >
          <template slot-scope="scope">
            <dict-tag :options="typeList" :value="scope.row.type" />
          </template>
        </el-table-column>

        <el-table-column
          label="操作"
          align="center"
          class-name="small-padding fixed-width"
          width="240"
        >
          <template slot-scope="scope">
            <el-button
              size="mini"
              type="text"
              icon="el-icon-edit"
              @click="handleUpdate(scope.row, 'xiugai')"
              v-hasPermi="['system:sample:edit']"
              >修改</el-button
            >
            <el-button
              size="mini"
              type="text"
              icon="el-icon-delete"
              @click="handleDelete(scope.row)"
              v-hasPermi="['system:sample:remove']"
              >删除</el-button
            >
            <el-dropdown
              @command="(command) => handleCommand(command, scope.row)"
            >
              <span class="el-dropdown-link">
                <i class="el-icon-d-arrow-right el-icon--right"></i>更多
              </span>
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item
                  command="handleDownLoad"
                  icon="el-icon-download"
                  v-hasPermi="['system:sample:export']"
                  >下载矢量图</el-dropdown-item
                >
                <el-dropdown-item
                  command="handleDownLoadThumbnailImg"
                  icon="el-icon-download"
                  v-hasPermi="['system:sample:export']"
                  >下载缩略图
                </el-dropdown-item>
              </el-dropdown-menu>
            </el-dropdown>

            <!-- <el-button size="mini" type="text" icon="el-icon-download" @click="handleDownLoad(scope.row)"></el-button>
            <el-button size="mini" type="text" icon="el-icon-download" @click="handleDownLoadThumbnailImg(scope.row)"></el-button> -->
            <el-dropdown
              v-if="false"
              size="mini"
              @command="(command) => handleCommand(command, scope.row)"
            >
              <span class="el-dropdown-link">
                <i class="el-icon-d-arrow-right el-icon--right"></i>更多
              </span>
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item
                  command="handleDownLoad"
                  icon="el-icon-download"
                  v-hasPermi="['system:sample:export']"
                  >下载矢量图</el-dropdown-item
                >
              </el-dropdown-menu>
            </el-dropdown>
          </template>
        </el-table-column>
      </el-table>

      <pagination
        v-show="total > 0"
        :total="total"
        :page.sync="queryParams.pageNum"
        :limit.sync="queryParams.pageSize"
        @pagination="getList"
      />
    </div>
    <!-- 添加或修改对话框 -->
    <el-dialog
      v-dialogDrag
      custom-class="draw_dioalog"
      width="655px"
      :title="title"
      :visible.sync="drawer"
      :before-close="handleClose"
    >
      <el-form
        ref="identifyForm"
        :model="formData"
        :rules="rules"
        size="small"
        label-width="120px"
      >
        <el-form-item label="应用范围" prop="appliedRange">
          <el-select
            v-model="formData.appliedRange"
            placeholder="请选择应用范围"
            clearable
            :style="{ width: '100%' }"
          >
            <el-option
              v-for="(item, index) in shiyongfanweiOptions"
              :key="index"
              :label="item.dictLabel"
              :value="item.dictValue"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="标识类别" prop="classifyId">
          <el-select
            v-model="formData.classifyId"
            placeholder="请选择标识类别"
            clearable
            :style="{ width: '100%' }"
            @change="classifyChange"
          >
            <el-option
              v-for="(item, index) in indetifyClassifyOptions"
              :key="index"
              :label="item.label"
              :value="item.id"
              :disabled="item.disabled"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="标识名称" prop="nameId">
          <el-select
            v-model="formData.nameId"
            placeholder="请选择标识名称"
            clearable
            :style="{ width: '100%' }"
          >
            <el-option
              v-for="(item, index) in identifyNameOptions"
              :key="index"
              :label="item.label"
              :value="item.id"
              :disabled="item.disabled"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="标识位置" prop="location" v-if="false">
          <el-input
            v-model="formData.location"
            placeholder="写明单位和具体位置 例：国网万荣供电公司中心营业厅"
            clearable
            :style="{ width: '100%' }"
          >
          </el-input>
        </el-form-item>
        <el-form-item label="标识数量" prop="num" v-if="false">
          <el-input-number
            v-model="formData.num"
            :min="1"
            placeholder="请输入标识数量"
          ></el-input-number>
        </el-form-item>

        <el-form-item label="设计制作供应商" prop="company" v-if="false">
          <el-input
            v-model="formData.company"
            placeholder="写明制作供应商（供应商全称）"
            clearable
            :style="{ width: '100%' }"
          >
          </el-input>
        </el-form-item>
        <el-form-item label="制作日期" prop="productTime" v-if="false">
          <el-date-picker
            v-model="formData.productTime"
            format="yyyy-MM-dd"
            value-format="yyyy-MM-dd"
            placeholder="请选择制作日期"
            clearable
          ></el-date-picker>
        </el-form-item>
        <el-form-item label="管理人员" prop="manager" v-if="false">
          <el-input
            v-model="formData.manager"
            placeholder="各单位标识管理人员"
            clearable
            :style="{ width: '100%' }"
          >
          </el-input>
        </el-form-item>
        <el-form-item label="示例类型" prop="type">
          <el-select v-model="formData.type" placeholder="请选择示例类型">
            <el-option
              v-for="item in typeList"
              :key="item.dictValue"
              :label="item.dictLabel"
              :value="item.dictValue"
            ></el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="上传图片" prop="validateImg1">
          <div class="uploadImg">
            <!-- 0-未审核，1-审核通过，2-审核不通过,3-审核退回   status!=1  可以修改上传图片&&!=审核 -->
            <el-upload
              class="avatar-uploader"
              ref="uploadImg"
              list-type="picture-card"
              :file-list="formData.uploadImgList"
              :action="uploadFileUrl"
              multiple
              :on-success="handleUploadSuccess"
              :before-upload="handleBeforeUpload"
              :headers="headers"
              name="uploadfile"
              accept=".jpg, .jpeg, .png, .gif, .bmp, .JPG, .JPEG, .PBG, .GIF, .BMP"
            >
              <i class="el-icon-plus"></i>
            </el-upload>
          </div>
          <div class="el-upload__tip">
            请上传
            <template> 大小不超过 <b style="color: #f56c6c">5MB</b> </template>
            <template>
              格式为 <b style="color: #f56c6c">jpg/jepg/png</b>
            </template>
            的文件
          </div>
        </el-form-item>
        <el-form-item label="矢量图" prop="validateImg2">
          <!-- 0-未审核，1-审核通过，2-审核不通过,3-审核退回   status!=1  可以修改上传图片&&!=shenhe -->
          <FileUpload
            ref="fileUpload"
            :fileSize="200"
            :value="formData.imgList"
            :fileType="fileType"
            :limit="limit"
            @input="uploadSuccess"
            @delete="deleteFile"
          ></FileUpload>
        </el-form-item>
        <el-form-item label="标识应用说明" prop="remark">
          <el-input
            type="textarea"
            v-model="formData.remark"
            placeholder="未上传的与此相同的标识有几个（非必填）"
            clearable
            :style="{ width: '100%' }"
          >
          </el-input>
        </el-form-item>
      </el-form>
      <div slot="footer">
        <el-button @click="cancel">取消</el-button>
        <el-button type="primary" @click="submitForm">确定</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import {
  listApplication,
  getApplication,
  exportImg,
  delIdentify,
  addApplication,
  updateApplication,
  downLoadApproval, //审批单
  exportByIds, //id下载
  exportApplication, //导出全部
  auditApplication, //审核
} from "@/api/identity/application";
import { treeselectCategory } from "@/api/identity/category";
import { getToken } from "@/utils/auth";
import { deepClone } from "@/utils/index.js";
export default {
  name: "Img",
  data() {
    var validateImg1 = (rule, value, callback) => {
      let index = this.formData.imgList.findIndex((item) => {
        return item.type == 1;
      });
      if (index < 0) {
        callback(new Error("请上传缩略图"));
      } else {
        callback();
      }
    };
    var validateImg2 = (rule, value, callback) => {
      let index = this.formData.imgList.findIndex((item) => {
        return item.type == 2;
      });
      if (index < 0) {
        callback(new Error("请上传矢量图"));
      } else {
        callback();
      }
    };
    return {
      //当前左侧行
      identityRow: {},
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 表格数据
      imgList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      drawer: false,
      // 图片id字典
      imgIdOptions: [],
      // 标识信息id字典
      imgIdentifyIdOptions: [],
      // 图片地址字典
      imgUrlOptions: [],
      shiyongfanweiOptions: [
        {
          dictLabel: "省公司",
          dictValue: "1",
        },
        {
          // dictLabel: "省直属单位",
          dictLabel: "市公司直属单位",
          dictValue: "2",
        },
      ],
      // 图片类型，1-普通图片，2-矢量图字典
      imgTypeOptions: [],
      // 创建时间字典
      imgTimeOptions: [],
      //示例类型
      typeList: [],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
      },
      // 表单参数
      form: {},
      // 表单参数
      formData: {
        classifyId: undefined,
        nameId: undefined,
        location: undefined,
        num: 1,
        company: undefined,
        productTime: undefined,
        manager: undefined,
        creCompany: undefined,
        remark: 1,
        type: "1",
        imgList: [],
        imgList2: [],
        thumbnailImg: [
          {
            url: "",
          },
        ],
      },
      // 表单校验
      rules: {
        classifyId: [
          { required: true, message: "请选择标识类别", trigger: "change" },
        ],
        nameId: [
          { required: true, message: "请选择标识名称", trigger: "blur" },
        ],
        location: [
          { required: true, message: "请输入标识位置", trigger: "blur" },
        ],
        num: [{ required: true, message: "请输入标识数量", trigger: "blur" }],
        company: [
          {
            required: true,
            message: "请输入设计制作供应商",
            trigger: "change",
          },
        ],
        productTime: [
          { required: true, message: "请选择日期", trigger: "change" },
        ],
        manager: [
          { required: true, message: "请输入管理人员", trigger: "change" },
        ],
        remark: [
          { required: false, message: "请输入标识应用说明", trigger: "blur" },
        ],
        type: [{ required: true, message: "请选择示例类型", trigger: "blur" }],
        validateImg1: [{ required: true, validator: validateImg1 }],
        validateImg2: [{ required: true, validator: validateImg2 }],
      },
      uploadFileUrl: process.env.VUE_APP_BASE_API + "/system/sample/upload", // 上传的图片服务器地址
      headers: {
        Authorization: getToken(),
      },
      //标识类别
      indetifyClassifyOptions: [],
      //标识名称
      identifyNameOptions: [],

      fileType: ["cdr", "ppt", "pdf"],
      fileType2: ["jpg", "jepg", "png"],
      limit: 1,
    };
  },
  created() {
    this.getList();
    this.getIdentifyCategory();
    this.getDicts("sample_type").then((response) => {
      this.typeList = response.data;
    });
  },
  methods: {
    /** 查询列表 */

    getList() {
      listApplication(this.queryParams).then((response) => {
        this.imgList = response.rows;
        console.log(" this.imgList: ", this.imgList);
        this.total = response.total;
      });
    },
    /**获取分类列表 */
    getIdentifyCategory() {
      treeselectCategory().then((res) => {
        console.log(res);
        // res.data.unshift({ label: "全部", id: null });
        this.indetifyClassifyOptions = res.data;

        // this.$refs.xTree.setCurrentRow(res.data[0], true);
      });
    },
    //点击左侧部门列表
    clickListRow(row) {
      console.log("row: ", row);
      if (this.identityRow.id == row.id) return;
      this.identityRow = row;
      this.queryParams = {
        // creCompany: row.id,
        nameId: row.children ? null : row.id,
        classifyId: row.children ? row.id : null,
        pageNum: 1,
        pageSize: 10,
      };
      this.getList();
    },
    //标识类别发生改变时
    classifyChange(classify) {
      console.log(" classify: ", classify);
      if (classify) {
        let a = this.indetifyClassifyOptions.find((item) => {
          return item.id == classify;
        });
        this.identifyNameOptions = a.children;
      }

      this.formData.nameId = undefined;
      this.queryParams.nameId = undefined;
      console.log("this.identifyNameOptions: ", this.identifyNameOptions);
    },
    //抽屉关闭前
    handleClose(done) {
      this.$confirm("需要提交表单吗？")
        .then((_) => {
          this.submitForm();
        })
        .catch((_) => {
          done();
        });
    },
    //缩略图上传之前
    handleBeforeUpload(file) {
      // console.log("file: ", file);
      // 校检文件类型
      if (this.fileType2) {
        let fileExtension = "";
        if (file.name.lastIndexOf(".") > -1) {
          fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1);
        }
        const isTypeOk = this.fileType2.some((type) => {
          if (file.type.indexOf(type) > -1) return true;
          if (fileExtension && fileExtension.indexOf(type) > -1) return true;
          return false;
        });
        if (!isTypeOk) {
          this.msgError(
            `文件格式不正确, 请上传${this.fileType2.join(" ， ")}格式文件!`
          );
          return false;
        }
      }
      // 校检文件大小
      if (this.fileSize) {
        const isLt = file.size / 1024 / 1024 < this.fileSize;
        if (!isLt) {
          this.$message.error(`上传文件大小不能超过 ${this.fileSize} MB!`);
          return false;
        }
      }
      return true;
    },
    //缩略图上传成功
    handleUploadSuccess(res, file) {
      console.log("res, file: ", res, file);
      let obj = {
        url: res.url,
        type: 1,
      };
      this.formData.imgList.push(obj);
    },
    //矢量图上传成功
    uploadSuccess(res) {
      let arr = [];
      let obj = {};
      res.forEach((item) => {
        console.log("item: ", item);
        obj = {
          type: 2,
          url: item.response.url,
        };
        arr.push(obj);
        console.log("obj: ", obj);
      });
      console.log("arr: ", arr);
      let type1 = this.formData.imgList.filter((item) => {
        return item.type == 1;
      });
      console.log("type1: ", type1);
      arr.push(...type1);
      this.formData.imgList = arr;
      console.log("this.formData.imgList: ", this.formData.imgList);
    },
    deleteFile(ids, index) {
      console.log("ids, index: ", ids, index);
    },
    // 取消按钮
    cancel() {
      this.drawer = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.formData = {
        classifyId: undefined,
        nameId: undefined,
        location: undefined,
        num: 1,
        company: undefined,
        productTime: undefined,
        manager: undefined,
        creCompany: undefined,
        remark: undefined,
        type: "2",
        imgList: [],
        imgList2: [],
        thumbnailImg: [
          {
            url: "",
          },
        ],

        // creCompany: this.userInfo.deptId,
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;

      console.log(" this.queryParams: ", this.queryParams);
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.queryParams.classifyId = undefined;
      this.queryParams.nameId = undefined;
      this.queryParams.appliedRange = undefined;
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map((item) => item.identifyId);
      this.single = selection.length !== 1;
      this.multiple = !selection.length;
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.drawer = true;
      this.title = "新增示例";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const identifyId = row.identifyId;

      getApplication(identifyId).then((response) => {
        console.log("response: ", response);
        // response.data.uploadImgList = [];
        // let list = deepClone(response.data.imgList);
        // list.forEach((item2) => {
        //   item2.type == 1 &&
        //     response.data.uploadImgList.push({
        //       url: `${process.env.VUE_APP_BASE_API}${item2.url}`,
        //     });
        // });

        this.formData = response.data;
        this.drawer = true;
        this.title = "修改示例库";
      });
    },

    /** 提交按钮 */
    submitForm() {
      console.log("this.formData: ", this.formData);

      this.$refs["identifyForm"].validate((valid) => {
        if (valid) {
          if (this.formData.identifyId != null) {
            updateApplication(this.formData).then((response) => {
              this.msgSuccess("修改成功");
              this.drawer = false;
              this.getList();
            });
          } else {
            addApplication(this.formData).then((response) => {
              this.msgSuccess("新增成功");
              this.drawer = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const identifyId = row.identifyId || this.ids;
      console.log("identifyId: ", identifyId);
      this.$confirm("是否确认删除选中的示例数据?", "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(function () {
          return delIdentify(identifyId);
        })
        .then(() => {
          this.getList();
          this.msgSuccess("删除成功");
        })
        .catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      const queryParams = this.queryParams;
      this.$confirm("是否确认导出所有数据项?", "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          return exportImg(queryParams);
        })
        .then((response) => {
          this.resolveBlob2(response, "xlsx", "下载");
          // this.download(response.data);
        })
        .catch(() => {});
    },
    // 更多操作触发
    handleCommand(command, row) {
      switch (command) {
        case "handleDownLoad":
          this.handleDownLoad(row);
          break;
        case "handleDownLoadThumbnailImg":
          this.handleDownLoadThumbnailImg(row);
          break;
        default:
          break;
      }
    },
    handleDownLoad(row) {
      this.$confirm("是否确认下载该标识矢量图文件?", "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(function () {
          return downLoadApproval({
            identifyId: row.identifyId,
          });
        })
        .then((response) => {
          console.log("response: ", response);
          let exportName = row.classifyName + "_" + row.name + "_";
          this.resolveBlob2(response, "zip", exportName + "矢量图");
        })
        .catch(() => {});
    },
    handleDownLoadThumbnailImg(row) {
      console.log("row: ", row);
      this.$confirm("是否确认下载该标识缩略图文件?", "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(function () {
          return downLoadThumbnailImg({
            identifyId: row.identifyId,
          });
        })
        .then((response) => {
          console.log("response: ", response);
          let exportName = row.classifyName + "_" + row.name + "_";
          this.resolveBlob2(response, "zip", exportName + "缩略图");
        })
        .catch(() => {});
    },
    // 应用范围字典翻译
    appliedRangeFormat(row, column) {
      return this.selectDictLabel(this.shiyongfanweiOptions, row.appliedRange);
    },
  },
};
</script>
<style lang="scss" scoped>
.uploadImg {
  display: flex;
  justify-content: space-between;
  align-items: center;

  // 标题图片上传
  ::v-deep .avatar-uploader {
    // height: 160px;
    // border: 1px dashed #4e4d4d;
    padding: 4px;
    border-radius: 6px;
    .el-upload {
      border: 1px dashed #4e4d4d;
      border-radius: 6px;
      cursor: pointer;
      position: relative;
      overflow: hidden;
      padding: 4px;
    }
  }
  .avatar-uploader .el-upload:hover {
    border-color: #409eff;
  }
  .avatar-uploader-icon {
    font-size: 28px;
    color: #8c939d;
    width: 150px;
    height: 150px;
    line-height: 150px;
    text-align: center;
  }
  .avatar {
    width: 100%;
    max-width: 100%;
    height: 150px;
    display: block;
  }
}
.sample-container {
  display: flex;
  flex-direction: row;
  .content_l {
    min-width: 240px;
    height: 100%;
    background: #fffbf0 !important;
    display: flex;
    flex-direction: column;
    .left-table {
      flex: 1;
      height: 0;
      overflow: overlay;
    }
  }
  .content_r {
    flex: 1;
    width: 0;
    margin: 0 0 0 10px;
    overflow: auto;
    padding: 10px;
    height: 100%;
    flex: 1;
  }
}
</style>
<style lang="scss">
.draw_dioalog {
  width: 655px;
  .el-dialog__body {
    max-height: 60vh;
    overflow: auto;
    ::v-deep .el-icon-close-tip {
      display: none !important;
      visibility: hidden;
    }
  }
}
.thumbnailImg {
  img {
    height: auto;
    width: auto;
    max-height: 100%;
    max-width: 100%;
  }
}
</style>
